FROM registry.cn-beijing.aliyuncs.com/yangzhetony/cnp:1.0
COPY php-extension /var/php-extension
RUN yum -y update
RUN yum install -y net-tools
RUN yum install -y libpng-devel libjpeg-devel
COPY var/www/ /var/www/
# COPY var/www/log/error.log /var/www/log/error.log
COPY php/php.ini /etc/php.ini
COPY php/php-fpm.conf /etc/php-fpm.conf
COPY nginx/nginx.conf /etc/nginx/nginx.conf
# COPY cron/root /var/spool/cron/root

RUN yum install -y supervisor
COPY supervisor/supervisord.conf /etc/supervisord.conf
RUN yum install -y git 

RUN cd /var/php-extension && tar xzvf ImageMagick.tar.gz && \
    cd ImageMagick-7.1.1-29 && \
    ./configure --with-png --with-jpeg && \
    make && make install
#     # export PKG_CONFIG_PATH=/usr/local/imagemagick/lib/pkgconfig:$PKG_CONFIG_PATH
RUN cd /var/php-extension && tar xzvf mongodb-1.14.0.tgz && \
    cd mongodb-1.14.0 && phpize && \
    ./configure --with-php-config=/usr/bin/php-config  && \
    make && make install
RUN cd /var/php-extension && tar zxvf imagick-3.5.0RC2.tgz && \
    cd imagick-3.5.0RC2 && phpize && \
    ./configure && \
    make && make install
# RUN yum install python3-devel python3-pip -y
# RUN pip3 install -i https://pypi.douban.com/simple flask
# RUN pip install Flask && pip install zhipuai && pip install python-dotenv
# # USER root 
# COPY supervisor/supervisord.conf /etc/supervisord.conf
# RUN systemctl start supervisord.service  
# RUN systemctl enable supervisord.service  

# EXPOSE 1-65535
# COPY ./supervisor/supervisord.service /etc/systemd/system/supervisord.service
# # # RUN sed -i 's/\r$//' /var/www/system/docker.sh
# ENTRYPOINT ["supervisord", "-c", "/etc/supervisord.conf"]
# 安装supervisor所需的依赖  
# RUN yum install -y epel-release  
# RUN yum install -y python-setuptools  
# RUN easy_install supervisor  
  
# 创建supervisor配置文件目录  
# RUN mkdir -p /etc/supervisor/conf.d  
  
# 将自定义的supervisor配置文件复制到容器内  
# COPY supervisor/supervisor.conf /etc/supervisor/conf.d/  
  
# 暴露supervisor的web管理界面端口（可选）  
# EXPOSE 9001  
  
# 设置容器启动后执行的命令  
# CMD ["supervisord", "-c","-n", "/etc/supervisor/conf.d/supervisor.conf"]

# CMD ["sh","-c","/etc/supervisord.conf"]
CMD ["sh","/var/www/system/docker.sh",">","logfile.log","2>&1"]